package com.bawei.mall.product.service.impl;

import com.bawei.common.core.domain.R;
import com.bawei.mall.product.domain.MallProductAdvertiseInfo;
import com.bawei.mall.product.domain.MallProductFlashPromotion;
import com.bawei.mall.product.domain.MallProductHomeInfo;
import com.bawei.mall.product.service.IMallProductAdvertiseInfoService;
import com.bawei.mall.product.service.IMallProductBrandInfoService;
import com.bawei.mall.product.service.IMallProductHomeInfoService;
import com.bawei.mall.product.service.IMallProductInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName MallProductHomeInfoServiceImpl
 * @Description 描述
 * @Author ZiZheng.Li
 * @Date 2024/6/30 15:32
 */
@Service
public class MallProductHomeInfoServiceImpl implements IMallProductHomeInfoService {
    @Autowired
    private IMallProductBrandInfoService brandInfoService;

    @Autowired
    private IMallProductInfoService productInfoService;

    @Autowired
    private IMallProductAdvertiseInfoService advertiseInfoService;

    @Override
    public R<MallProductHomeInfo> content() {
        MallProductHomeInfo homeInfo = new MallProductHomeInfo();
        //广告
        homeInfo.setAdvertiseList(advertiseInfoService.selectMallProductAdvertiseInfoList(new MallProductAdvertiseInfo()));
        //品牌信息
        homeInfo.setBrandList(brandInfoService.selectMallProductBrandInfoList(null));
        //秒杀专区
        homeInfo.setHomeFlashPromotion(new MallProductFlashPromotion());
        //新鲜好物
        homeInfo.setNewProductList(productInfoService.selectNewProductInfoList());
        //人气推荐
        homeInfo.setHotProductList(productInfoService.selectHotProductInfoList());
        return R.ok(homeInfo);
    }
}
